// antd 按需加载
import { Toast } from '@ant-design/react-native';

import store from '../../../store/store.js'
import * as ActionTypes from '../../../constants/constants.js'
import { isUser, isWxUser, path, saveData, loadData, removeData } from '../../../util/utils.js'
import request from '../../../api/request.js'

export async function getUserLogin(options) {
    const { dispatch } = this.props
    const res = await request.getUserLogin(options)
    return new Promise((resolve, reject) => {
        if (res.state == 1) {
            dispatch({
                type: ActionTypes.GET_USER_INFO,
                data: res.data
            })
            resolve(res)
        } else {
            reject(res)
        }
    })
}
